package com.example.bdd.demo.pages;

import com.example.bdd.demo.base.BddBaseService;
import com.example.bdd.demo.intf.PageAction;
import com.example.bdd.demo.model.BddAutoFillData;
import org.openqa.selenium.By;

public class IndexPageService implements PageAction<BddAutoFillData> {

    private BddBaseService service;

    public IndexPageService(BddBaseService service){
        this.service = service;
    }

    @Override
    public void setFields(final BddAutoFillData bddData) {
        setLoginName(bddData.getName());
        setLoginPassword(bddData.getPassword());
    }

    public void setLoginName(String content) {
        service.setFieldValue(By.id("name"), content);
    }

    public void setLoginPassword(String content) {
        service.setFieldValue(By.id("password"), content);
    }



}
